<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		</style>
	</head>
<body>
<?php
			$goods_id=$_POST['goods_id'];
			$goods_discuss=$_POST['goods_discuss'];
			$db=@mysqli_connect('localhost','root','123456','db_exchange')//利用mysqli_connect()连接到数据库
			or die("无法连接到数据库");
			mysqli_query($db,"set names 'utf8'");
			$q="insert into tb_discuss(goods_id,goods_discuss) values('$goods_id','$goods_discuss')";//定义一条SQL语句，将提交到本页面的username,password数据提交到数据库ex_change中的tb_login表中
			$result=mysqli_query($db,$q);//利用mysqli_query()来执行上面的SQL文件，返回结果我true或者false，将结果返回给$result
			if($result){
				echo "<script>alert('评论成功！');history.back()</script>";
			}
			mysqli_close($db);//断开与数据库的连接
?>

</body>